const request = (params) => {
	// 显示加载数据的提示
	uni.showLoading({
		title: '加载中',
		mask: true
	})
	return new Promise(function(resolve, reject) {
		const baseUrl = getApp().globalData.ServerUrl;
		uni.request({
			method: params.method,
			data: params.data,
			url:baseUrl + params.url,
			header: params.header,
			success(res) {
				setTimeout(function() {
					resolve(res.data)
				}, 100);
			},
			fail(err) {
				reject(err)
			},
			complete() {
				setTimeout(function() {
					uni.hideLoading()
				}, 100);
 
			}
		})
	})
}
export default request;